import {
  Constant_Enum_Enum_CashBack_Status,
  Constant_Enum_Enum_CashBack_Way,
  Constant_Enum_Name_CashBack_Status,
  Constant_Enum_Name_CashBack_Way,
  IConstant_Enum_Type_CashBack_Status,
  IConstant_Enum_Type_CashBack_Way,
} from '@/common/constants/enum';
import { Decorator_DtoIsNumber_Base } from '@/common/decorators/dtoIsNumber';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';

export class CashBack_Create_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  @ApiProperty({ type: 'float', description: '申请提现金额' })
  applyMoney: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({
    description: '打款方式' + Constant_Enum_Name_CashBack_Way,
    enum: Constant_Enum_Enum_CashBack_Way,
  })
  cashBackWay: IConstant_Enum_Type_CashBack_Way;
}

export class CashBack_FindWeb_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;
}
export class CashBack_OrderListFind_Dto {
  @Decorator_DtoIsNumber_Base()
  @ApiProperty({ description: '返现ID' })
  @IsNotEmpty()
  id: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;
}

export class CashBack_Find_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  size?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  page?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ description: '用户id' })
  userClientId?: number;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '用户昵称' })
  userClientName?: string;

  @IsString()
  @IsOptional()
  @ApiProperty({
    description: '打款状态' + Constant_Enum_Name_CashBack_Status,
    enum: Constant_Enum_Enum_CashBack_Status,
  })
  status?: IConstant_Enum_Type_CashBack_Status;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ type: 'bigint', description: '开始时间' })
  cashStartTime?: number;

  @Decorator_DtoIsNumber_Base()
  @IsOptional()
  @ApiProperty({ type: 'bigint', description: '结束时间' })
  cashEndTime?: number;
}

export class CashBack_Pass_Dto {
  @Decorator_DtoIsNumber_Base()
  @IsNotEmpty()
  id: number;

  @IsString()
  @IsOptional()
  @ApiProperty({ description: '打款截图' })
  cashBackImg?: string;
}
